package au.com.iglootech.silmbox_sm.enities;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Queries;
import javax.jdo.annotations.Query;

import com.google.appengine.api.datastore.Key;


@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
@Queries({
    @Query(name = "findByUsername", value = "SELECT FROM User u where u.username == :username")
})
public class User {
    private static final long serialVersionUID = 1L;

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private String username;

    @Persistent
    private Date createdDate;

    @Persistent
    private Date modifiedDate;

    @Persistent(defaultFetchGroup = "true")
    private Key createdUser;

    @Persistent(defaultFetchGroup = "true")
    private Key modifiedUser;

    @Persistent
    private String password;

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getModifiedDate() {
		return modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	public Key getCreatedUser() {
		return createdUser;
	}

	public void setCreatedUser(Key createdUser) {
		this.createdUser = createdUser;
	}

	public Key getModifiedUser() {
		return modifiedUser;
	}

	public void setModifiedUser(Key modifiedUser) {
		this.modifiedUser = modifiedUser;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

    

}
